

/*
 * AgregarDedicacionView.java
 *
 * Created on 17-may-2012, 19:58:33
 */
package educar.abmDedicacion;

import java.awt.event.ActionListener;
import javax.swing.JButton;

/**
 *
 * @author Flubber
 */
public class AgregarDedicacionView extends javax.swing.JDialog {

// <editor-fold defaultstate="collapsed" desc="Constructor">
    public AgregarDedicacionView() {
        initComponents();
    }
// </editor-fold>

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jbAceptar = new javax.swing.JButton();
        jbCancelar = new javax.swing.JButton();
        jlTitulo = new javax.swing.JLabel();
        jlCodFacultad = new javax.swing.JLabel();
        jtfDNIDocente = new javax.swing.JTextField();
        jlDNIDocente = new javax.swing.JLabel();
        jlCodCargo = new javax.swing.JLabel();
        jtfCodCargo = new javax.swing.JTextField();
        jtfCodFacultad = new javax.swing.JTextField();
        jlDedicacion = new javax.swing.JLabel();
        jcbDedicacion = new javax.swing.JComboBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);

        jbAceptar.setText("Aceptar");

        jbCancelar.setText("Cancelar");

        jlTitulo.setFont(new java.awt.Font("Tahoma", 1, 14));
        jlTitulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlTitulo.setText("Agregar Nueva Dedicacion");

        jlCodFacultad.setFont(new java.awt.Font("Tahoma", 1, 12));
        jlCodFacultad.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlCodFacultad.setText("Codigo de Facultad");

        jlDNIDocente.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jlDNIDocente.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlDNIDocente.setText("DNI del Docente");

        jlCodCargo.setFont(new java.awt.Font("Tahoma", 1, 12));
        jlCodCargo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlCodCargo.setText("Codigo de Cargo");

        jlDedicacion.setFont(new java.awt.Font("Tahoma", 1, 12));
        jlDedicacion.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlDedicacion.setText("Dedicacion");

        jcbDedicacion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Semi Exclusiva", "Full", "Simple" }));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jbAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jbCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jlDedicacion, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jcbDedicacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(147, 147, 147))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(28, 28, 28)
                        .addComponent(jlTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 301, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jlCodCargo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jlCodFacultad, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jlDNIDocente, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jtfCodFacultad)
                            .addComponent(jtfCodCargo, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
                            .addComponent(jtfDNIDocente, javax.swing.GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jlTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtfDNIDocente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jlDNIDocente, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlCodFacultad, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtfCodFacultad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlCodCargo, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtfCodCargo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlDedicacion, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jcbDedicacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

// <editor-fold defaultstate="collapsed" desc="Declaracion de variables">    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jbAceptar;
    private javax.swing.JButton jbCancelar;
    private javax.swing.JComboBox jcbDedicacion;
    private javax.swing.JLabel jlCodCargo;
    private javax.swing.JLabel jlCodFacultad;
    private javax.swing.JLabel jlDNIDocente;
    private javax.swing.JLabel jlDedicacion;
    private javax.swing.JLabel jlTitulo;
    private javax.swing.JTextField jtfCodCargo;
    private javax.swing.JTextField jtfCodFacultad;
    private javax.swing.JTextField jtfDNIDocente;
    // End of variables declaration//GEN-END:variables
// </editor-fold>
    
    public void setTitulo(String Titulo) {
        this.jlTitulo.setText(Titulo);
    }
    
    public JButton getJbAceptar() {
        return jbAceptar;
    }

    public JButton getJbCancelar() {
        return jbCancelar;
    }
    
    public String getCodCargo() {
        return jtfCodCargo.getText();
    }

    public String getCodFacultad() {
        return jtfCodFacultad.getText();
    }

    public String getDNIDocente() {
        return jtfDNIDocente.getText();
    }

    public String getDedicacion() {
        return jcbDedicacion.getSelectedItem().toString();
    }

    public void setCodCargo(String CodCargo) {
        this.jtfCodCargo.setText(CodCargo);
    }

    public void setCodFacultad(String CodFacultad) {
        this.jtfCodFacultad.setText(CodFacultad);
    }

    public void setDNIDocente(String DINDocente) {
        this.jtfDNIDocente.setText(DINDocente);
    }

    public void setDedicacion(String Dedicacion) {
        this.jcbDedicacion.setSelectedItem(Dedicacion);
    }
   
    /**
     * Asigna un Listener a los Botones
     * @param listener
     */     
    public void setActionListener(ActionListener listener) {
        jbAceptar.addActionListener(listener);
        jbCancelar.addActionListener(listener);
    }
}
